import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n

//element-ui
import '../theme/index.css'

import '@/styles/index.scss' // global css


import {i18n} from '@/i18n/index'

import App from './App'
import router from './router'
import store from './store'

import '@/icons' // icon

import '@/theme/index.scss'
// import '@/permission' // permission control

// import '../mock-server/index'

//引入nprogress
import NProgress from 'nprogress'
import 'nprogress/nprogress.css' //这个样式必须引入
// 简单配置
NProgress.inc(0.2)
NProgress.configure({ easing: 'ease', speed: 500, showSpinner: false })


// import echarts from "echarts"
// Vue.prototype.$echarts = echarts

router.beforeEach((to,from,next) => {
  NProgress.start()
  next()
})

router.afterEach(() => {
  NProgress.done()
})


Vue.use(ElementUI, {
  locale
})

new Vue({
  el: '#app',
  router,
  i18n,
  store,
  render: h => h(App)
})